home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / tsfilt21.zip / UNZIPTXT.BAT < prev    next >
DOS Batch File  |  1991-10-16  |  3KB  |  113 lines

  1. @echo off
  2. echo ┌───────────────────────────────────────────────┐
  3. echo │ Unzip text files from zip file(s)             │
  4. echo │ Convert Unix eolns of to PC eolns             │
  5. echo │ preserving the original date/time stamp       │
  6. echo │ By Prof. Timo Salmi Wed 16-Oct-1991           │
  7. echo └───────────────────────────────────────────────┘
  8. echo.
  9.  
  10. rem Give usage if necessary
  11. if "%1"=="" goto _noname
  12.  
  13. rem Check that the needed drive exists
  14. if not exist r:\nul goto _no_r
  15.  
  16. rem Check that u2pc.bat is available (rem the test to speed up the bacth)
  17. set _found=
  18. if exist u2pc.bat set _found=yes
  19. for %%d in (%path%) do if exist %%d\u2pc.bat set _found=yes
  20. if not "%_found%"=="yes" goto _no_u2pc
  21.  
  22. rem Check that unix2pc.exe is available (rem the test to speed up the bacth)
  23. set _found=
  24. if exist unix2pc.exe set _found=yes
  25. for %%d in (%path%) do if exist %%d\unix2pc.exe set _found=yes
  26. if not "%_found%"=="yes" goto _no_unix2pc
  27.  
  28. rem Check that touch.exe is available (rem the test to speed up the bacth)
  29. set _found=
  30. if exist touch.exe set _found=yes
  31. for %%d in (%path%) do if exist %%d\touch.exe set _found=yes
  32. if not "%_found%"=="yes" goto _no_touch
  33.  
  34. rem Check that pcopy.exe is available (rem the test to speed up the bacth)
  35. set _found=
  36. if exist pcopy.exe set _found=yes
  37. for %%d in (%path%) do if exist %%d\pcopy.exe set _found=yes
  38. if not "%_found%"=="yes" goto _no_pcopy
  39.  
  40. rem Skip the redundant tests in u2pcbat
  41. set _checked=yes
  42.  
  43. rem Make a temporary directory
  44. mkdir r:\tempdir$
  45.  
  46. rem Unzip all the zips to the temporary directory
  47. for %%f in (%1) do pkunzip %%f r:\tempdir$
  48.  
  49. rem Convert the Unix eolns to MsDos eolns
  50. for %%f in (r:\tempdir$\*.*) do call c:\bat\u2pc %%f
  51. @echo off
  52.  
  53. rem Copy the converted files to r:\
  54. pcopy r:\tempdir$\*.* r:\ /u/ba/ns
  55.  
  56. rem Remove the temporary files and the temporary directory
  57. echo y|del r:\tempdir$\*.*
  58. rmdir r:\tempdir$
  59.  
  60. rem Show the results
  61. dir r:\
  62. goto _out
  63.  
  64. :_noname
  65. echo ╔══════════════════════════╗
  66. echo ║ Usage: UNZIPTXT FileName ║
  67. echo ╚══════════════════════════╝
  68. echo.
  69. echo Wildcards and paths allowed
  70. echo.
  71. echo ╒══════════════════════════════════╕
  72. echo │ At least DOS version 3.30 needed │
  73. echo ╘══════════════════════════════════╛
  74. goto _out
  75.  
  76. :_notfound
  77. echo File %1 not found
  78. goto _out
  79.  
  80. :_no_r
  81. echo You need to have directory R:\ available, or you have to adjust r:\
  82. echo in the batch as befits your own configuration.
  83. goto _out
  84.  
  85. :_no_u2pc
  86. echo U2PC.BAT must be at the present directory or at path.
  87. echo U2PC is a part of my TSFILT collection.
  88. goto _out
  89.  
  90. :_no_unix2pc
  91. echo UNIX2PC.EXE must be at the present directory or at path.
  92. echo UNIX2PC is a part of my TSFILT collection.
  93. goto _out
  94.  
  95. :_no_touch
  96. echo TOUCH.EXE must be at the present directory or at path.
  97. echo TOUCH is a part of my TSUTLB collection.
  98. goto _out
  99.  
  100. :_no_pcopy
  101. echo Patriquin's PCOPY.EXE must be at the present directory or at path.
  102. goto _out
  103.  
  104. :_not_text
  105. echo File %1 is not an ordinary ascii text file
  106. echo The conversion not made
  107. goto _out
  108.  
  109. :_out
  110. set _found=
  111. set _checked=
  112. echo on
  113.